#pragma once
#include <QObject>
#include <QHostAddress>

class AbstractRoom;

class AbstractUser : public QObject {
    Q_OBJECT
public:
    explicit AbstractUser(quint16 id, const QHostAddress& addr, quint16 port, AbstractRoom* room = nullptr, QObject* parent = nullptr);

    qint16 getID() const { return m_id; }
    const QHostAddress& getAddress() const { return addr; }
    const quint16& getPort() const { return port; }

    void joinRoom(AbstractRoom* room) { this->room = room; }
    AbstractRoom* getRoom() { return room; }

private:
    quint16 m_id;

    QHostAddress addr;
    quint16 port;

    AbstractRoom* room;
};